Zero-th order approximation : The steady state and the balanced-growth path ============================================================================= We have already seen how to create a program for solving the steady state inside the model file. But as we have argued, that approach has some limitations. The most flexible way to approach the solving of the steady state and the balanced-growth path is through the writing of a steady-state file. Below is an example for some function, say, simple_ssfile :: simple_ssfile-- computes the steady state of the model analytically Syntax: [y,newp,retcode]=simple_ssfile(m,y,p,d,id) Args: - **m** [rise|dsge]: model object (not always needed) - **y** [vector|2-column matrix]: - endo_nbr x 1 vector of initial steady state : stationary models - endo_nbr x 2 matrix of initial steady state and growth rate : nonstationary models - **pp** [struct]: parameter structure - **d** [struct]: definitions - **id** [vector]: location of the variables to calculate Returns: - **y** [vector|2-column matrix]: - endo_nbr x 1 vector of updated steady state : stationary models - endo_nbr x 2 matrix of updated steady state and growth rate : nonstationary models - **newp** [struct]: structure containing updated parameters if any - **retcode** [0|number]: return 0 if there are no problems, else return any number different from 0 .. note:: this is new approach has three main advantages : - The file is valid whether we have many regimes or not - The user does not need to know what regime is being computed - It is in sync with the steady state model RISE will call the function twice. The first call will be with one argument (the first one) only and will be about collecting two types of information : - The list of variables for which the steady state is solved and the order, freely chosen by the user, in which the calculations will be returned. - The list of parameters whose value is computed in the steady state In the second call, RISE will provide all input arguments. It is then expected that the user returns the steady state and the parameters computed in steady state. Here is a complete listing for a balanced-growth path file for the simple model above but without the comments :: function [y,newp,retcode]=simple_ssfile(m,y,p,d,id) %#ok retcode=0; if nargin==1 % list of endogenous variables to be calculated and the order in which they will appear y={'Y','Z','h'}; newp={};% list of parameters to be computed during steady state calculation else % steady states and new parameter values %--------------------------------------- newp = struct(); h=[1/3,0]; Z=[p.zss,p.mu]; Y=[Z(1)*h(1),Z(2)]; ys=[Y;Z;h]; % ordering the output according to the list above if any(isnan(ys(:)))% check the validity of the calculations retcode=1; else % push the calculations %---------------------- y(id,:)=ys; end end end Incomplete analytical solution --------------------------------- Sometimes the programs written by the user do not solve the steady state or the balanced-growth path completely. This can occur either because the user can only calculate part of the steady state or that RISE created auxiliary variables. In the case of optimal policy, for instance, RISE creates lagrange multipliers. While RISE knows how to handle the auxiliary variables it creates, it will try to solve for the other variables numerically, given the incomplete steady state provided by the user. Steady state loops -------------------- Sometimes, the user can compute the steady state or part of the steady state conditional on the knowledge of a particular variable. For instance, in an optimal policy problem in which only monetary policy is missing, the knowledge of steady-state inflation may help solve for all other endogenous variables excluding the lagrange multipliers (automatically taken care of). The user will write a steady state file that takes as given the missing variables he does not know how to compute. RISE gives a proposal for those missing variables in the the second argument of the steady state file. Locating the proposal for the missing variables is not difficult. All the user has to do is to collect the location the missing variables in the list given by:: get(m,'endo_list') With the locations in hand, the user will go ahead and collect the proposed values in the y vector (or 2-column matrix) and then do the rest of the computations. The burden of RISE is lessened because RISE needs only to find the solution for a subset of variables. .. hint:: The user needs to set the option **sstate_loop** to true to inform RISE that only a subset of variables is unknown Facilitators -------------- When solving the steady state or balanced-growth path numerically, one can take advantage of some facilitators. And those facilitators can be combined. Equation simplification ~~~~~~~~~~~~~~~~~~~~~~~~~ This is the situation where the user provides both a dynamic equation and a steady-state version of the equation. For instance :: log(X{t}) = (1-rho)*log(xss) + rho*log(X{t-1}) + sig*E{t} # ... X{t}=xss; log(Z{t}/Z{t-1}) = log(muz) +sigz*EZ{t} # ... Z{t} = muz*Z{t-1}; Declaring Log and level variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Besides the economic interpretation, there is another benefit of taking log approximations. When the steady state is solved numerically, the search domain for log variables is :math:`(0,+\infty)`. This prevents us from running into singularities such as : - division by 0 - log of zero - log of negative values Setting bounds on variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ RISE gives us the possibility of defining the search space for the steady state and the growth rate of variables when solving numerically. See the **sstate** method of rise objects for more details. The case of multiple regimes ------------------------------- The presence of multiple regimes does not pose any additional difficulties for the computation of the steady state. In this case, the steady state is just computed for : - the ergodic mean of parameters: see :cite:`FRWZ2016` - different vectors of parameters corresponding to each regime: see e.g. :cite:`MaihWaggoner2018` or :cite:`ChangMT2021`.